package phapp.model.system;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;

/**
 * Title: ts_role_info 数据类 POJO Description: DAO层映射到数据类,页面封装数据映射到数据类 Copyright:
 * Copyright (c) 2012-10 Company:
 * 
 * @author you name
 * @version 1.0
 */

public class Role extends BaseEntity
{

   // date formats
   public static final String FORMAT_CREATE_DATE = DATE_TIME_FORMAT;
   public static final String FORMAT_UPDATE_DATE = DATE_TIME_FORMAT;

   // columns START
   /** roleId */
   private java.lang.Integer roleId;
   /** roleName */
   private java.lang.String roleName;
   /** roleDesc */
   private java.lang.String roleDesc;
   /** roleStatus */
   private java.lang.Integer roleStatus;
   /** createDate */
   private java.sql.Timestamp createDate;
   /** updateDate */
   private java.sql.Timestamp updateDate;
   /**  角色是否有 */
   private boolean selected;
   
   private java.util.ArrayList idList;

   // columns END

   public Role()
   {
   }

   public Role(java.lang.Integer roleId)
   {
      this.roleId = roleId;
   }

   public boolean isSelected() {
	    return selected;
	}
	
	public void setSelected(boolean selected) {
		this.selected = selected;
	}

public void setId(java.lang.Integer value)
   {
      this.roleId = value;
   }

   public java.lang.Integer getId()
   {
      return this.roleId;
   }
   
   public void setRoleId(java.lang.Integer value)
   {
      this.roleId = value;
   }

   public java.lang.Integer getRoleId()
   {
      return this.roleId;
   }

   public void setRoleName(java.lang.String value)
   {
      this.roleName = value;
   }

   public java.lang.String getRoleName()
   {
      return this.roleName;
   }

   public void setRoleDesc(java.lang.String value)
   {
      this.roleDesc = value;
   }

   public java.lang.String getRoleDesc()
   {
      return this.roleDesc;
   }

   public void setRoleStatus(java.lang.Integer value)
   {
      this.roleStatus = value;
   }

   public java.lang.Integer getRoleStatus()
   {
      return this.roleStatus;
   }

   public String getCreateDateString()
   {
      return date2String(getCreateDate(), FORMAT_CREATE_DATE);
   }

   public void setCreateDateString(String value)
   {
      setCreateDate(string2Date(value, FORMAT_CREATE_DATE, java.sql.Timestamp.class));
   }

   public void setCreateDate(java.sql.Timestamp value)
   {
      this.createDate = value;
   }

   public java.sql.Timestamp getCreateDate()
   {
      return this.createDate;
   }

   public String getUpdateDateString()
   {
      return date2String(getUpdateDate(), FORMAT_UPDATE_DATE);
   }

   public void setUpdateDateString(String value)
   {
      setUpdateDate(string2Date(value, FORMAT_UPDATE_DATE, java.sql.Timestamp.class));
   }

   public void setUpdateDate(java.sql.Timestamp value)
   {
      this.updateDate = value;
   }

   public java.sql.Timestamp getUpdateDate()
   {
      return this.updateDate;
   }

   public java.util.ArrayList getIdList()
   {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList)
   {
      this.idList = idList;
   }

   /** 手动增加属性后,toString,hashCode,equals都要修改 */
   public String toString()
   {
      return new ToStringBuilder(this).append("RoleId", getRoleId()).append("RoleName", getRoleName()).append("RoleDesc", getRoleDesc()).append("RoleStatus", getRoleStatus()).append("CreateDate", getCreateDate()).append("UpdateDate", getUpdateDate())
               .toString();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(getRoleId()).append(getRoleName()).append(getRoleDesc()).append(getRoleStatus()).append(getCreateDate()).append(getUpdateDate()).toHashCode();
   }

   public boolean equals(Object obj)
   {
      if (obj instanceof Role == false) return false;
      if (this == obj) return true;
      Role other = (Role) obj;
      return new EqualsBuilder().append(getRoleId(), other.getRoleId()).append(getRoleName(), other.getRoleName()).append(getRoleDesc(), other.getRoleDesc()).append(getRoleStatus(), other.getRoleStatus()).append(getCreateDate(), other.getCreateDate())
               .append(getUpdateDate(), other.getUpdateDate()).isEquals();
   }
}
